package jsen.tool.ddd.adapter.infrastructure.specification.demo.spec.line;

import jsen.tool.ddd.adapter.infrastructure.specification.ISpecification;
import jsen.tool.ddd.adapter.infrastructure.specification.base.Sdl;
import jsen.tool.ddd.adapter.infrastructure.specification.base.SdlSpecificationSupplier;
import jsen.tool.ddd.adapter.infrastructure.specification.demo.Line;


/**
 * @author jsen
 * @date 2021/10/6
 */
public class LineSpecFactory {
    public static ISpecification<Line> buildSpec() {
        SdlSpecificationSupplier factory = new SdlSpecificationSupplier();
        factory.register("LineSpec", LineSpec::new);

        String sdl = "LineSpec";
        return new Sdl<Line>(sdl, factory).and(Line::getWidth, new LineWidthSpec());
    }
}
